-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
DOC: Merge FAQ and gotcha (rebase of GH13768) #15222
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
lgtm! |
Current coverage is 85.98% (diff: 100%)@@ master #15222 diff @@
==========================================
Files 140 140
Lines 51272 51275 +3
Methods 0 0
Messages 0 0
Branches 0 0
==========================================
+ Hits 44087 44089 +2
- Misses 7185 7186 +1
Partials 0 0
|
thanks! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jreback maybe we can leave things open for review for slightly longer next time? :)
Label-based indexing with integer axis labels is a thorny topic. It has been | ||
discussed heavily on mailing lists and among various members of the scientific | ||
Python community. In pandas, our general viewpoint is that labels matter more | ||
than integer locations. Therefore, with an integer axis index *only* |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would remove "with an integer axis index" -- I think this applies to everything.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, you are right. Originally this was a part about ix
, and then this made more sense (the ix was replaced by loc after the deprecation)
I didn't really review the content of these parts, only moved them (apart from the comment that were already made on the other PR), but good to do that now as well.
s.loc['c':'e'+1] | ||
|
||
A very common use case is to limit a time series to start and end at two | ||
specific dates. To enable this, we made the design design to make label-based |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a bad example -- it's easy to calculate a following timestamp!
(To be honest, I am no longer convinced that end inclusive indexing is a good idea. But we are stuck with it for backwards compatibility.)
Indexing potentially changes underlying Series dtype | ||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | ||
|
||
The different indexing operation can potentially change the dtype of a ``Series``. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's clarify this is a little more:
"The different indexing operation"
->
"Indexing with Series with a list of index locations that do not exist"
Might be good to cover DataFrame dtype changes with indexing here, too, but I think it's a bit more complicated because of block consolidation.
@@ -1,18 +1,92 @@ | |||
.. currentmodule:: pandas | |||
.. _gotchas: | |||
|
|||
******************************** | |||
Frequently Asked Questions (FAQ) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure it really makes sense to call this new page "FAQ" until we rephrase the section headers as questions.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, good catch, that is a leftover from the other PR. I changed everything from FAQ back to gotchas, apart from the header.
Rebase and clean-up of pandas-dev#13768 closes pandas-dev#9809 Author: Joris Van den Bossche <[email protected]> Author: sinhrks <[email protected]> Closes pandas-dev#15222 from jorisvandenbossche/pr/13768 and squashes the following commits: 7abb65b [Joris Van den Bossche] Make 'indexing may change dtype' more general 53a6970 [Joris Van den Bossche] Move HTML libraries gotchas to html io docs 7185dd4 [Joris Van den Bossche] Keep original gotchas label for references c9e41cc [Joris Van den Bossche] Redo updates after ix deprecation ab7fdf0 [Joris Van den Bossche] restore file name f5e0af0 [sinhrks] DOC: Merge FAQ and gotcha
Rebase and clean-up of #13768
closes #9809